<!DOCTYPE html>
<html lang="en">

<head>
   
  <meta charset="UTF-8">
   
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
   
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
    const clearTxt = (text, arr) => {
      arr.forEach(item => {
        const reg = new RegExp(item, 'gi')
        text = text.replace(reg, '');
      })
      console.log(arr, 'arr--')
      return text;
    }
    let str = clearTxt("建国是来自东北铁岭的正宗东北汉子", ["东北"])
    console.log(str, 'str---')
  </script>
</body>

</html>